<?php

class shopController extends manageController {

    public function __construct() {
        if (!isset($_SESSION['zp_store']['islogin']) || empty($_SESSION['zp_store']['islogin'])) {
            Tools::AlertTxt('?md=store&cl=login&at=login', '请先登录');
            exit;
        }
    }

    public function homeAction() {
//        unset($_SESSION[zp_store][islogin]);
        # 待指派
        $ordersCount0 = $this->model->GetOrderCount(0);

        # 已指派
        $ordersCount1 = $this->model->GetOrderCount(1);

        # 待接单
        $ordersCount2 = $this->model->GetOrderCount(2);

        # 待取货
        $ordersCount3 = $this->model->GetOrderCount(3);

        # 配送中
        $ordersCount4 = $this->model->GetOrderCount(4);

        # 完成
        $ordersCount5 = $this->model->GetOrderCount(5);

        # 异常
        $ordersCount6 = $this->model->GetErrorOrderCount();

        # 骑手
        $ordersCount7 = $this->model->GetRidersCount();

        $num = ['ordersCount0'=>$ordersCount0,'ordersCount1'=>$ordersCount1,'ordersCount2'=>$ordersCount2,'ordersCount3'=>$ordersCount3,
            'ordersCount4'=>$ordersCount4,'ordersCount5'=>$ordersCount5,'ordersCount6'=>$ordersCount6,'ordersCount7'=>$ordersCount7];
        $this->view->setVariable("num", $num);
        $this->view->setViewfilepath(MvcReg::$_moduleName . '/views/index/' . MvcReg::$_actionName . 'View.php');
        $this->view->render();
    }

    public function indexAction() {
        header('Location: index.php?md=store&cl=login&at=login');
        $this->view->render();
    }

    public function adminAction() {
        $table = "supervisor";
        $func = (!empty($this->params['func'])) ? $this->params['func'] : '';
        $page = (!empty($this->params['page'])) ? (int) $this->params['page'] : 1;
        $number_page = (!empty($this->params['number_page'])) ? $this->params['number_page'] : Data::$_number_page;
        $this->view->setVariable("number_page", $number_page);
        $this->view->setVariable("page", $page);

        $query = (!empty($this->params['query'])) ? $this->params['query'] : '';
        $query = urldecode($query);
        $this->view->setVariable("query", $query);
        $q_permission = (!empty($this->params['q_permission'])) ? $this->params['q_permission'] : '';
        $this->view->setVariable("q_permission", $q_permission);

//        echo '<pre>';
//
//        var_dump($this->params);die;
        //上下線
        if (!empty($func) && $func == "status") {
            $id = empty($this->params["id"]) ? '0' : (int) $this->params["id"];
            if ($id > 0) {
                $where_fields = array("AND" => array("=" => array("id" => $id)));
                $row = $this->model->getItemById($id, $table);
                $field = array();
                $field['status'] = $row['status'] == '1' ? '0' : '1';
                $field['editor'] = $_SESSION['zp_store']['uid'];
                $field['updatedt'] = 'now()';
                $r = $this->model->updateItem($field, $where_fields, $table);

                //日志
                $log = array();
                $log['table_id'] = $id;
                $log['table_name'] = $table;
                $log['type'] = 4;
                $log['page'] = "账号上下线";
                $log['content'] = $log['page'] . "：" . $this->params["id"];
                $org = array();
                $field1 = array();
                $this->model->setLog($log, $org, $field1);
            }
           echo json_encode(array('status'=>1),JSON_UNESCAPED_UNICODE);
            exit;
        }

        //刪除
        if (!empty($func) && $func == "del") {
            $id = empty($this->params["id"]) ? '0' : (int) $this->params["id"];
            $field = array("isdeleted" => 1, 'editor' => $_SESSION['zp_store']['uid'], 'updatedt' => 'now()');
            $where_fields = array("AND" => array("=" => array("id" => $id)));
            $this->model->updateItem($field, $where_fields, $table);

            //日志
            $log = array();
            $log['table_id'] = $id;
            $log['table_name'] = $table;
            $log['type'] = 3;
            $log['page'] = "删除账号";
            $log['content'] = $log['page'] . "：" . $this->params["id"];
            $org = array();
            $field1 = array();
            $this->model->setLog($log, $org, $field1);
            echo json_encode(array('status'=>1),JSON_UNESCAPED_UNICODE);
            exit;
        }

        //抓列表
        $where_fields = array("AND" => array("=" => array("isdeleted" => 0)));
        if (!empty($q_permission)) {
            $where_fields['AND']['=']['said'] = $q_permission;
        }
        $like_fields = array();
        if (!empty($query)) {
            $like_fields = array('account' => $query, 'name' => $query);
        }
        $orderby = array('id' => 'asc');
        $total_count = $this->model->getTotalCount($table, $where_fields, $like_fields);
        $rsp_list = $this->model->getAllByPage($page, $number_page, $where_fields, $table, $like_fields, $orderby);
        $rsp_page_list = Tools::getPagesPost($_SERVER["QUERY_STRING"], $number_page, $page, $total_count);

        //权限
        $where_fields = array("AND" => array("=" => array("isdeleted" => 0)));
        $permission_list = $this->model->getAll($where_fields, 'systemallows', '', '');
        foreach ($permission_list as $k => $value) {
            $value['name'] = $value['name'] . ($value['status'] == 1 ? '' : '(%{OFFLINE}%)');
            $permission_list[$k] = $value;
        }
        $permission_list = Tools::getArray($permission_list, 'name');
        $this->view->setVariable("permission_list", $permission_list);

//        echo '<pre>';
//        var_dump($rsp_list);
        $this->view->setVariable("rsp_list", $rsp_list);
        $this->view->setVariable("rsp_page_list", $rsp_page_list);
        $this->view->setVariable("total_count", $total_count);
        $this->view->setVariable("page", $page);
        $this->view->setVariable("number_page", $number_page);
        $this->view->setViewfilepath(MvcReg::$_moduleName . '/views/index/' . MvcReg::$_actionName . 'View.php');
        $this->view->render();
    }

    public function adminaddAction() {
        $table = "supervisor";
        $page = (!empty($this->params['page'])) ? $this->params['page'] : 1;
        $number_page = (!empty($this->params['number_page'])) ? $this->params['number_page'] : Data::$_number_page;
        $this->view->setVariable("number_page", $number_page);
        $this->view->setVariable("page", $page);
        $id = (!empty($this->params['id'])) ? (int) $this->params['id'] : 0;

        if ($id > 0) {
            //抓單筆資料
            $rsp_row = $this->model->getItemById($id, $table);
            $this->view->setVariable("rsp_row", $rsp_row);
        }
        //权限
        $where_fields = array("AND" => array("=" => array("isdeleted" => 0, 'status' => 1)));
        $orderby = array('rank' => 'asc');
        $permission_list = $this->model->getAll($where_fields, 'systemallows', $orderby, '');
        $permission_list = Tools::getArray($permission_list, 'name');
        $this->view->setVariable("permission_list", $permission_list);


//        echo '<pre>';
//        var_dump($rsp_row);

        $this->view->setVariable("number_page", $number_page);
        $this->view->setViewfilepath(MvcReg::$_moduleName . '/views/index/' . MvcReg::$_actionName . 'View.php');
        $this->view->render();
    }

    public function adminupdateAction() {
        $table = 'supervisor';
        $page = (!empty($this->params['page'])) ? (int)$this->params['page'] : 1;
        $id = (!empty($this->params['id'])) ? (int) $this->params['id'] : '';
        $said = (!empty($this->params['said'])) ? $this->params['said'] : '';
        $account = (!empty($this->params['account'])) ? $this->params['account'] : '';
        $name = (!empty($this->params['name'])) ? $this->params['name'] : '';
        $email = (!empty($this->params['email'])) ? $this->params['email'] : '';
        $pwd = (!empty($this->params['pwd'])) ? $this->params['pwd'] : '';
        $status = (!empty($this->params['status'])) ? $this->params['status'] : '1';

        $field["said"] = $said;
        $field['name'] = $name;
//        $field['email'] = $email;
        $field['status'] = $status;
        $field["editor"] = $_SESSION['zp_store']['uid'];

        if (!empty($pwd)) {
            $salt = Data::getSalt(20);
            $field['salt'] = $salt;
            $saltpwd = sha1($salt . $pwd);
            $field['password'] = $saltpwd;
        }

        if (empty($id)) {
            //確認重覆
            $where = array("AND" => array("=" => array('account' => $account, 'isdeleted' => 0)));
            $result = $this->model->getItemByOther($where, $table);
            if (count($result) > 0) {
                $vaild_msg= '账号重复';
                Tools::GoToPrev($vaild_msg);
                return;
            } else {
                //新增
                $field['account'] = $account;
                $field["isdeleted"] = 0;
                $field['createdt'] = 'now()';
                $r = $this->model->addItem($field, $table);

                //日志
                $log = array();
                $log['table_id'] = $r;
                $log['table_name'] = $table;
                $log['type'] = 1;
                $log['page'] = "新增账号";
                $log['content'] = $log['page'] . "：" . $account;
                $org = array();
                $this->model->setLog($log, $org, $field);
            }
        } else {
            //修改
            $org = $this->model->getItemById($id, $table);
            $field['updatedt'] = 'now()';
            $where_fields = array("AND" => array("=" => array('id' => $id, "isdeleted" => 0)));
            $r = $this->model->updateItem($field, $where_fields, $table);

            //日志
            $log = array();
            $log['table_id'] = $id;
            $log['table_name'] = $table;
            $log['type'] = 2;
            $log['page'] = "修改账号";
            $log['content'] = $log['page'] . "：" . $account;
            $this->model->setLog($log, $org, $field);
        }

        $url = '?md=' . MvcReg::$_moduleName . '&cl=' . MvcReg::$_controllerName . '&at=' . str_replace('update', '', MvcReg::$_actionName);
        $url .='&page='.$page;
        Tools::AlertTxt($url, $this->getKeyWord('SAVE') . $this->getKeyWord('Msg_Successful'));
    }

    //修改密码
    public function changepwdAction() {
        $table = 'supervisor';
        $pwd = (!empty($this->params['pwd'])) ? $this->params['pwd'] : '';
        $cpwd = (!empty($this->params['cpwd'])) ? $this->params['cpwd'] : '';

        $this->view->setViewfilepath(MvcReg::$_moduleName . '/views/index/' . MvcReg::$_actionName . 'View.php');
        $this->view->render();
    }

    public function changepwdupdateAction() {
        $table = 'xd_store';
        $oldpwd = (!empty($this->params['oldps'])) ? $this->params['oldps'] : '';
        $pwd = (!empty($this->params['newps'])) ? $this->params['newps'] : '';
        $cpwd = (!empty($this->params['conps'])) ? $this->params['conps'] : '';
        $id = $_SESSION["zp_store"]["zp_store_code"];
        $url = '?md=' . MvcReg::$_moduleName . '&cl=' . MvcReg::$_controllerName . '&at=' . str_replace('update', '', MvcReg::$_actionName);
        if ($oldpwd == "" || $pwd == "" || $cpwd == "") {
            Tools::AlertTxt($url, "有未填选项");
            exit;
        }
        if ($pwd != $cpwd) {
            Tools::AlertTxt($url, "两次密码不相等");
            exit;
        }

        $where = ['AND'=>['='=>['store_id'=>$_SESSION["zp_store"]["zp_store_code"]]]];
        $row = $this->model->getItemByOther($where, $table);

//        echo'<pre>';
//        var_dump($row);die;
        $saltpwd = sha1($row[0]['salt'] . $oldpwd);
        if ($saltpwd != $row[0]['password']) {
            Tools::AlertTxt($url, "原始密码填写不正确");
            exit;
        }

        if (!empty($pwd)) {
            $salt = Data::getSalt(20);
            $field['salt'] = $salt;
            $saltpwd = sha1($salt . $pwd);
            $field['password'] = $saltpwd;
        }

        $field['updatedt'] = 'now()';
        $field["editor"] = $_SESSION["zp_store"]["zp_store_code"];
        $where_fields = array("AND" => array("=" => array('store_id' => $_SESSION["zp_store"]["zp_store_code"])));
        $r = $this->model->updateItem($field, $where_fields, $table);

        //$url = '?md=' . MvcReg::$_moduleName . '&cl=' . MvcReg::$_controllerName . '&at=' . str_replace('update', '', MvcReg::$_actionName);
        Tools::AlertTxt($url, $this->getKeyWord('SAVE') . $this->getKeyWord('Msg_Successful'));
    }

    public function admingroupAction() {

        $table = "systemallows";
        $func = (!empty($this->params['func'])) ? $this->params['func'] : '';
        $page = (!empty($this->params['page'])) ? (int) $this->params['page'] : 1;
        $number_page = (!empty($this->params['number_page'])) ? $this->params['number_page'] : Data::$_number_page;
        $this->view->setVariable("number_page", $number_page);
        $this->view->setVariable("page", $page);

        $query = (!empty($this->params['query'])) ? $this->params['query'] : '';
        $query = urldecode($query);
        $this->view->setVariable("query", $query);


        //上下線
        if (!empty($func) && $func == "status") {
            $id = empty($this->params["id"]) ? '0' : (int) $this->params["id"];
            if ($id > 0) {
                $where_fields = array("AND" => array("=" => array("id" => $id)));
                $row = $this->model->getItemById($id, $table);
                $field = array();
                $field['status'] = $row['status'] == '1' ? '0' : '1';
                $field['editor'] = $_SESSION['zp_store']['uid'];
                $field['updatedt'] = 'now()';
                $r = $this->model->updateItem($field, $where_fields, $table);

                //日志
                $log = array();
                $log['table_id'] = $id;
                $log['table_name'] = $table;
                $log['type'] = 4;
                $log['page'] = "账号上下线";
                $log['content'] = $log['page'] . "：" . $this->params["id"];
                $org = array();
                $field1 = array();
                $this->model->setLog($log, $org, $field1);
            }
            echo json_encode(array('status'=>1),JSON_UNESCAPED_UNICODE);
            exit;
        }

        //刪除
        if (!empty($func) && $func == "del") {
            $id = empty($this->params["id"]) ? '0' : (int) $this->params["id"];
            $field = array("isdeleted" => 1, 'editor' => $_SESSION['zp_store']['uid'], 'updatedt' => 'now()');
            $where_fields = array("AND" => array("=" => array("id" => $id)));
            $this->model->updateItem($field, $where_fields, $table);

            //日志
            $log = array();
            $log['table_id'] = $id;
            $log['table_name'] = $table;
            $log['type'] = 3;
            $log['page'] = "权限删除";
            $log['content'] = $log['page'] . "：" . $this->params["id"];
            $org = array();
            $field1 = array();
            $this->model->setLog($log, $org, $field1);
            echo json_encode(array('status'=>1),JSON_UNESCAPED_UNICODE);
//            Tools::AlertTxt('?md=' . MvcReg::$_moduleName . '&cl=' . MvcReg::$_controllerName . '&at=' . MvcReg::$_actionName . '&page=' . $page, $this->getKeyWord('Success_Operate'));
            exit;
        }

        //抓列表
        $where_fields = array("AND" => array("=" => array("isdeleted" => 0)));
        $like_fields = array();
        if (!empty($query)) {
            $like_fields = array('name' => $query);
        }
        $orderby = array('rank' => 'asc');
        $total_count = $this->model->getTotalCount($table, $where_fields, $like_fields);
        $rsp_list = $this->model->getAllByPage($page, $number_page, $where_fields, $table, $like_fields, $orderby);
        $rsp_page_list = Tools::getPagesPost($_SERVER["REQUEST_URI"], $number_page, $page, $total_count);

        $this->view->setVariable("total_count", $total_count);
        $this->view->setVariable("rsp_list", $rsp_list);
        $this->view->setVariable("rsp_page_list", $rsp_page_list);
        $this->view->setVariable("page", $page);
        $this->view->setVariable("number_page", $number_page);
        $this->view->setViewfilepath(MvcReg::$_moduleName . '/views/index/' . MvcReg::$_actionName . 'View.php');
        $this->view->render();
    }

    public function admingroupaddAction() {

        $table = "systemallows";
        $page = (!empty($this->params['page'])) ? (int) $this->params['page'] : 1;
        $number_page = (!empty($this->params['number_page'])) ? $this->params['number_page'] : Data::$_number_page;
        $this->view->setVariable("number_page", $number_page);
        $this->view->setVariable("page", $page);
        $id = (!empty($this->params['id'])) ? (int) $this->params['id'] : 0;

        if ($id > 0) {
            //抓單筆資料
            $rsp_row = $this->model->getItemById($id, $table);
            $this->view->setVariable("rsp_row", $rsp_row);
        }

        $this->view->setVariable("page", $page);
        $this->view->setVariable("number_page", $number_page);
        $this->view->setViewfilepath(MvcReg::$_moduleName . '/views/index/' . MvcReg::$_actionName . 'View.php');
        $this->view->render();
    }

    public function admingroupupdateAction() {
        $table = 'systemallows';
        $page = (!empty($this->params['page'])) ? (int)$this->params['page'] : 1;
        $id = (!empty($this->params['id'])) ? (int) $this->params['id'] : '';
        $rank = (!empty($this->params['rank'])) ? (int) $this->params['rank'] : '';
        $name = (!empty($this->params['name'])) ? $this->params['name'] : '';
        $discription = (!empty($this->params['discription'])) ? $this->params['discription'] : '';
        $group = (!empty($this->params['group'])) ? $this->params['group'] : array();
//        var_dump($group);
//        die;
        if (empty($group)) {
            Tools::GoToPrev("请至少选择一项权限");
            exit;
        }

        $field["rank"] = $rank;
        $field["name"] = $name;
        $field["discription"] = $discription;
        $field["editor"] = $_SESSION['zp_store']['uid'];
        $field["permission"] = join($group, ' ');

        if (empty($id)) {
            //確認重覆
            $where = array("AND" => array("=" => array('name' => $name, 'isdeleted' => 0)));
            $result = $this->model->getItemByOther($where, $table);
            if (count($result) > 0) {
                $vaild_msg= '权限名称重复';
                Tools::GoToPrev($vaild_msg);
                return;
            } else {
                //新增 
                $field["isdeleted"] = 0;
                $field['createdt'] = 'now()';
                $field['updatedt'] = 'now()';
                $r = $this->model->addItem($field, $table);
            }

            //日志
            $log = array();
            $log['table_id'] = $r;
            $log['table_name'] = $table;
            $log['type'] = "ADD";
            $log['page'] = "新增权限";
            $log['content'] = $log['page'] . "：" . $name;
            $org = array();
            $this->model->setLog($log, $org, $field);
        } else {
            //修改
            $org = $this->model->getItemById($id, $table);
            $field['updatedt'] = 'now()';
            $where_fields = array("AND" => array("=" => array('id' => $id)));
            $r = $this->model->updateItem($field, $where_fields, $table);

            //日志
            $log = array();
            $log['table_id'] = $id;
            $log['table_name'] = $table;
            $log['type'] = "EDIT";
            $log['page'] = "修改权限";
            $log['content'] = $log['page'] . "：" . $name;
            $this->model->setLog($log, $org, $field);
        }

        $url = '?md=' . MvcReg::$_moduleName . '&cl=' . MvcReg::$_controllerName . '&at=' . str_replace('update', '', MvcReg::$_actionName);
        $url .='&page='.$page;
        Tools::AlertTxt($url, $this->getKeyWord('SAVE') . $this->getKeyWord('Msg_Successful'));
    }

    //操作日志
    public function logAction() {
        $table = "logdata";
        $func = (!empty($this->params['func'])) ? $this->params['func'] : '';
        $page = (!empty($this->params['page'])) ? (int) $this->params['page'] : 1;
        $number_page = (!empty($this->params['number_page'])) ? $this->params['number_page'] : Data::$_number_page;
        $this->view->setVariable("number_page", $number_page);
        $this->view->setVariable("page", $page);

        $title = (!empty($this->params['title'])) ? $this->params['title'] : '';
        $query = (!empty($this->params['query'])) ? $this->params['query'] : '';
        $query = urldecode($query);
        $this->view->setVariable("title", $title);
        $this->view->setVariable("query", $query);

        //刪除
        if (!empty($func) && $func == "del") {
            $id = empty($this->params["id"]) ? '0' : (int) $this->params["id"];
            $field = array("isdeleted" => 1, 'editor' => $_SESSION['zp_store']['uid'], 'updatedt' => 'now()');
            $where_fields = array("AND" => array("=" => array("id" => $id)));
            $this->model->updateItem($field, $where_fields, $table);
            Tools::AlertTxt('?md=' . MvcReg::$_moduleName . '&cl=' . MvcReg::$_controllerName . '&at=' . MvcReg::$_actionName . '&page=' . $page, $this->getKeyWord('Success_Operate'));
            return;
        }


        //抓列表
        $where_fields = array("AND" => array("=" => array("isdeleted" => 0)));
        if (!empty($title)) {
            $where_fields["AND"]["="]["page"] = $title;
        }
        if (!empty($query) && $query != "sap" && $query != "SAP") {
            $where = array("AND" => array("=" => array('account' => $query, 'isdeleted' => '0')));
            $editor_result = $this->model->getItemByOther($where, "supervisor");
            if (!empty($editor_result)) {
                $where_fields["AND"]["="]["editor"] = $editor_result[0]['id'];
            }
        } elseif ($query == "sap" || $query == "SAP") {
            $where_fields["AND"]["="]["editor"] = 0;
        }

        $like_fields = array();

        $orderby = array('id' => 'desc');
        $total_count = $this->model->getTotalCount($table, $where_fields, $like_fields);
        $rsp_list = $this->model->getAllByPage($page, $number_page, $where_fields, $table, $like_fields, $orderby);
        $rsp_page_list = Tools::getPagesPost($_SERVER["REQUEST_URI"], $number_page, $page, $total_count);

        foreach ($rsp_list as $k => $val) {
            if ($val["editor"] != 0) {
                $rs_editor = $this->model->getItemById($val["editor"], "supervisor");
                $rsp_list[$k]["editorname"] = $rs_editor["account"];
            } else {
                $rsp_list[$k]["editorname"] = "SAP";
            }
        }

        //获取所有的标题名称
        $title_list = array();
        $titles = $this->model->getLogPage();
        foreach ($titles as $val) {
            $title_list[$val['page']] = $val['page'];
        }
        $this->view->setVariable("title_list", $title_list);

        $this->view->setVariable("rsp_list", $rsp_list);
        $this->view->setVariable("rsp_page_list", $rsp_page_list);
        $this->view->setVariable("total_count", $total_count);
        $this->view->setVariable("page", $page);
        $this->view->setVariable("number_page", $number_page);
        $this->view->setViewfilepath(MvcReg::$_moduleName . '/views/index/' . MvcReg::$_actionName . 'View.php');
        $this->view->render();
    }


    //Hybris连线
    public function hybrislogAction() {
        $table = "log_hybris_error";
        $func = (!empty($this->params['func'])) ? $this->params['func'] : '';
        $page = (!empty($this->params['page'])) ? (int) $this->params['page'] : 1;
        $number_page = (!empty($this->params['number_page'])) ? $this->params['number_page'] : Data::$_number_page;
        $this->view->setVariable("number_page", $number_page);
        $this->view->setVariable("page", $page);

        $title = (!empty($this->params['title'])) ? $this->params['title'] : '';
        $query = (!empty($this->params['query'])) ? $this->params['query'] : '';
        $query = urldecode($query);
        $this->view->setVariable("title", $title);
        $this->view->setVariable("query", $query);


        //抓列表
        $where_fields = array("AND" => array("=" => array("isdeleted" => 0)));
        if (!empty($title)) {
            $where_fields["AND"]["="]["page"] = $title;
        }
        if (!empty($query) && $query != "sap" && $query != "SAP") {
            $where = array("AND" => array("=" => array('account' => $query, 'isdeleted' => '0')));
            $editor_result = $this->model->getItemByOther($where, "supervisor");
            if (!empty($editor_result)) {
                $where_fields["AND"]["="]["editor"] = $editor_result[0]['id'];
            }
        } elseif ($query == "sap" || $query == "SAP") {
            $where_fields["AND"]["="]["editor"] = 0;
        }

        $like_fields = array();

        $orderby = array('id' => 'desc');
        $total_count = $this->model->getTotalCount($table, $where_fields, $like_fields);
        $rsp_list = $this->model->getAllByPage($page, $number_page, $where_fields, $table, $like_fields, $orderby);
        $rsp_page_list = Tools::getPagesPost($_SERVER["REQUEST_URI"], $number_page, $page, $total_count);

        foreach ($rsp_list as $k => $val) {
            if ($val["editor"] != 0) {
                $rs_editor = $this->model->getItemById($val["editor"], "supervisor");
                $rsp_list[$k]["editorname"] = $rs_editor["account"];
            } else {
                $rsp_list[$k]["editorname"] = "SAP";
            }
        }

        $this->view->setVariable("rsp_list", $rsp_list);
        $this->view->setVariable("rsp_page_list", $rsp_page_list);
        $this->view->setVariable("total_count", $total_count);
        $this->view->setVariable("page", $page);
        $this->view->setVariable("number_page", $number_page);
        $this->view->setViewfilepath(MvcReg::$_moduleName . '/views/index/' . MvcReg::$_actionName . 'View.php');
        $this->view->render();
    }


}

?>
